home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 25
/
Cream of the Crop 25.iso
/
bbs
/
mhis020.zip
/
FINDCHAR.MH
< prev
next >
Wrap
Text File
|
1996-08-21
|
869b
|
33 lines
#ifndef __FINDCHAR_MH
#define __FINDCHAR_MH
#ifndef __COUNTCHA_MH
#include "countcha.mh"
#endif
// Returns true if all the characters in the string "chars" can be found
// in the string "theString". This is useful for checking user keys.
bool findAllChars (string: theString, string: chars) {
int: idx;
for (idx := 1; idx <= strlen (chars); idx := idx + 1) {
if (countChar (theString, chars [idx]) = 0)
return False;
};
return True;
}
// Returns true if any of the characters in the string "chars" can be found
// in the string "theString". Again, this is useful for working with user keys.
bool findAnyChars (string: theString, string: chars) {
int: idx;
for (idx := 1; idx <= strlen (chars); idx := idx + 1) {
if (countChar (theString, chars [idx])) return True;
};
return False;
}
#endif